package com.changgou.backend.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author xuchangshuo
 * @date 2020/7/29 14:51
 */
@RequestMapping("/page")
@Controller
public class PageController {
    //跳转商品页面
    @RequestMapping("/toGoods")
    public String toGoods() {
        return "goods";
    }

    //跳转sku列表
    @RequestMapping("/toSkuPage")
    public String toSkuPage() {
        return "sku";
    }

    //跳转主页面
    @RequestMapping("/toMain")
    public String toMain() {
        return "main";
    }

    //回收站页面
    @RequestMapping("/toTrach")
    public String toTrach() {
        return "trash";
    }

    //跳转订单页面
    @RequestMapping("/toorderpage")
    public String topage() {
        return "orderlist";
    }

    //跳转订单项页面
    @RequestMapping("/toOrderItem")
    public String toOrderItem() {
        return "orderItemsprint";
    }

    //跳转品牌页面
    @GetMapping("/tobrand")
    public String toBrand() {
        System.out.println("...");
        return "brand";
    }

    //规格参数页面
    @RequestMapping("/tospecAndPara")
    public String tospecAndPara() {
        return "specAndPara";
    }

    //跳转规格页面
    @GetMapping("/toSpec")
    public String toSpec(Model model, @RequestParam String id, @RequestParam String name) {
        model.addAttribute("id", id);
        model.addAttribute("name", name);
        return "spec";
    }

    //跳转参数页面
    @GetMapping("/toPara")
    public String toPara(Model model, @RequestParam("id") String id, @RequestParam("name") String name) {
        model.addAttribute("id", id);
        model.addAttribute("name", name);
        return "para";
    }

    //订单报表
    @RequestMapping("/toOrder")
    public String toOrder() {
        return "report_order";
    }

    //用户统计
    @RequestMapping("/toUser")
    public String toUser() {
        return "report_user";
    }

    //利润趋势统计
    @RequestMapping("/toProfit")
    public String toProfit() {
        return "report_profit";
    }

    //受欢迎度统计
    @RequestMapping("/toPopular")
    public String toPopular() {
        return "report_popular";
    }

    //商品评价页面
    @RequestMapping("/toevaluatepage")
    public String toevaluatepage() {
        return "orderevaluetes";
    }

}
